<%@ tag language="java" pageEncoding="UTF-8"%>

<%@ attribute name="name" rtexprvalue="true" required="true"%>
<%@ attribute name="label" rtexprvalue="true"%>
<%@ attribute name="required" rtexprvalue="true"%>
<%@ attribute name="value" rtexprvalue="true"%>
<%@ attribute name="single" rtexprvalue="true"%>
<%@ attribute name="help" rtexprvalue="true"%>
<%@ attribute name="size" rtexprvalue="true"%>
<%@ attribute name="widget" rtexprvalue="true"%>
<%@ attribute name="onchange" rtexprvalue="true"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="local"
	value="${pageContext.request.contextPath}/service/channelAction"
	scope="request" />
<script type="text/javascript"
	src="${local}/resource/My97DatePicker/WdatePicker.js"></script>

<c:if test="${size==null}">
	<c:set var="size" value="30"/>
</c:if>

<c:if test="${required==null}">
	<c:set var="required" value="false" />
</c:if>

<c:if test="${widget!=null}">
	<c:set var="name" value="${name}->${widget}" />
</c:if>

<c:choose>
	<c:when test="${single==null}">
		<c:set var="single" value="1" />
	</c:when>
	<c:when test="${single==1}">
		<c:set var="single" value="3" />
	</c:when>
	<c:otherwise>
		<c:set var="single" value="1" />
	</c:otherwise>
</c:choose>
<th><c:if test="${required}">
	<label class="requireField">*</label>
</c:if> <label>${label}:</label></th>

<td colspan="${single}">
	<input type="text" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
	style="width:${size}px" name="${name}" class="Wdate" value="${value}"
	<c:if test="${onchange!=null}"> onchange="${onchange}"</c:if>>${help}
</td>